/*
 * Copyright (c) 2018-2999 九五云信息科技有限公司 All rights reserved.
 *
 * https://www.gz-yami.com/
 *
 * 未经允许，不可做商业用途！
 *
 * 版权所有，侵权必究！
 */

package com.yami.shop.platform.controller;

import cn.hutool.core.date.DateUtil;
import cn.hutool.http.HttpUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yami.shop.bean.dto.SankeyDto;
import com.yami.shop.bean.model.Form;
import com.yami.shop.bean.param.FlowAnalysisParam;
import com.yami.shop.bean.param.FlowRouteAnalysisParam;
import com.yami.shop.bean.param.FlowUserAnalysisParam;
import com.yami.shop.common.util.PageParam;
import com.yami.shop.service.FlowPageAnalysisService;
import com.yami.shop.service.FlowRouteAnalysisService;
import org.apache.catalina.util.RequestUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * @author lgh on 2018/11/26.
 */
@RestController
@RequestMapping("/platform/flowRouteAnalysis")
public class FlowRouteAnalysisController {

    @Autowired
    private FlowRouteAnalysisService flowRouteAnalysisService;

    /**
     * 分页获取
     */
    @GetMapping("/getRoutData")
    public ResponseEntity<FlowRouteAnalysisParam> getRoutData(FlowRouteAnalysisParam flowRouteAnalysisParam) {
        flowRouteAnalysisParam.setTime();
        SankeyDto sankeyDto = flowRouteAnalysisService.getRoutData(flowRouteAnalysisParam);
        flowRouteAnalysisParam.setSankeyDto(sankeyDto);
        return ResponseEntity.ok(flowRouteAnalysisParam);
    }
}
